﻿using System;
using FinPlusComponents;
using p = FinPlusAnalytics.QLConvParser;
using u = FinPlusUtility.Utility;

namespace FinPlusAnalytics
{
    public class DefaultCurve : FinPlusComponent
    {
        public string Name { get; private set; }
        
        //public List<DefaultProbabilityHelper> Instruments { get; private set; }
        
        //construct
        public DefaultCurve(string marketName, string name, string discountCurveName, DateTime settlementDate, string spreads, double recoveryRate, string dayCount, string holidays)
        {
            Name = name;
            var market = Markets.Instance.GetMarket(marketName); 
            var calendar = p.Calendar(holidays);
            var res = u.StringToArray1d(spreads, ',');

            //Instruments = new List<DefaultProbabilityHelper>();// TODO
            //std::vector<boost::shared_ptr<DefaultProbabilityHelper> > instruments;
		
            //for each(std::string s in spreadsVector)
            //{
            //    boost::shared_ptr<DefaultProbabilityHelper> spread = defaultHelpers[marketName][s];
            //    if(spread) instruments.push_back(spread);
            //}

            //defaultCurves[marketName][curveName] = boost::shared_ptr<PiecewiseDefaultCurve<HazardRate, BackwardFlat>>(new PiecewiseDefaultCurve<HazardRate, BackwardFlat>(settleDate, instruments, DayCount(dayCount)));

            //DefaultEngine(marketName, curveName, discountCurveName, recoveryRate);
        }
    }
}
